{include file="public/header" /}
<style>
    .layui-copy{width: 30px;position:absolute;top:1px;bottom: 1px;right:1px;cursor:pointer;background:white;text-align: center;color: #999999c2;display: flex;align-items: center;justify-content: center;}
    .layui-copy:hover{color: #999999;}
</style>
<body class="gray-bg">
<div class="wrapper wrapper-content">
    <div class="ibox-content layui-form layui-form-pane">
        <div class="layui-row layui-col-space10 layui-form-item ">
            <div class="layui-form-item">
                <table class="layui-table">
                    <colgroup>
                        <col width="250">
                        <col width="200">
                        <col>
                    </colgroup>
                    <thead>
                    <tr>
                        <th>商品名</th>
                        <th>数量</th>
                        <th>单价</th>
                        <th>积分</th>
                    </tr>
                    </thead>
                    <tbody>
                    {foreach name="$data.info" item="vo"}
                    <tr>
                        <td>{$vo.oi_good_name}</td>
                        <td>{$vo.oi_num}</td>
                        <td>{$vo.oi_good_money}</td>
                        <td>{$vo.oi_jifen}</td>
                    </tr>
                    {/foreach}
                    </tbody>
                </table>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">订单号</label>
                <div class="layui-input-block">
                    <input type="text" class="layui-input layui-disabled" value="{$data.so_number?:''}">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">下单时间</label>
                <div class="layui-input-block">
                    <input type="text" class="layui-input layui-disabled" value="{$data.so_time?:''}">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">支付时间</label>
                <div class="layui-input-block">
                    <input type="text" class="layui-input layui-disabled" value="{$data.so_paytime?:''}">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">支付方式</label>
                <div class="layui-input-block">
                    <input type="text" class="layui-input layui-disabled" value="{if condition='$data.so_type==1'}支付宝{elseif condition='$data.so_type==2'}微信{/if}">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">金额</label>
                <div class="layui-input-block">
                    <input type="text" class="layui-input layui-disabled" value="{$data.so_money?:''}">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">总数</label>
                <div class="layui-input-block">
                    <input type="text" class="layui-input layui-disabled" value="{$data.so_num}">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">商铺</label>
                <div class="layui-input-block">
                    <input type="text" class="layui-input layui-disabled" value="{$data.s_name}">
                    <div class="layui-copy" onclick="wk.lay_copy(this)" title="复制" alt="复制"><span><i class="fa fa-paste"></i></span></div>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">收货地址</label>
                <div class="layui-input-block">
                    <input type="text" class="layui-input layui-disabled" value="{$data.s_address}">
                    <div class="layui-copy" onclick="wk.lay_copy(this)" title="复制" alt="复制"><span><i class="fa fa-paste"></i></span></div>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">手机号</label>
                <div class="layui-input-block">
                    <input type="text" class="layui-input layui-disabled" value="{$data.s_phone}">
                    <div class="layui-copy" onclick="wk.lay_copy(this)" title="复制" alt="复制"><span><i class="fa fa-paste"></i></span></div>
                </div>
            </div>
            <div class="layui-form-item layui-col-xs-offset2 layui-col-xs12">
                <div class="layui-input-block">
                    {if condition="$data.so_status == 2 && $data.so_in_out == 1 && $data.so_send_status == 1" }
                    <button class="btn btn-primary" onclick="peiSong('{$data.so_id}')"><i class="fa fa-send-o"></i> 去配送</button>
                    {/if}
                    <button class="btn btn-primary" onclick="wk.layer_show('编辑物流','{:url('wuliuEdit')}?id={$data.so_id}')"><i class="fa fa-pencil"></i> 编辑物流</button>
                </div>
            </div>
        </div>
    </div>
</div>
{include file="public/footer" /}
<script>
    var peiSong = function(id){
        layer.confirm('确认订单已配送111', {icon: 3, title:'提示'}, function(index){
            $.ajax({
                url: "{:url('delivery')}",
                type: "post",
                dataType: "json",
                data: "id=" + id,
                success: function (res) {
                    if(res.code == 200){
                        layer.msg(res.msg,{icon:1,time:1500,shade: 0.1},function(){
                            wk.layer_close()
                        });
                    } else if (res.code == 100){
                        layer.msg(res.msg,{icon:2,time:1500,shade: 0.1});
                    }
                }
            });
        });
    }

</script>
</body>
</html>